//只载入子模板文件
require(['Resource/Script/requireJs/_require.config.js?v='+Math.random()],function(){
  require(['vue','Common','axios'],function(vue,Common,axios){
    //根据模板变量设置配置信息
    let _options_ = {};
    if(varTemplate.formOptions) {
      _options_ = Object.assign(_options_,varTemplate.formOptions);
    } else {
      _options_ = Object.assign(_options_,varTemplate);
    }

    let opt = {
        el: '#app',
        mixins:[],
        components:null,
        data: function() {
          return {
          }
        },
        
        mounted : function() {
        }
    };

    //载入子模版文件
    let loadSontpl = function() {
      let promise = new Promise( function(resolve,reject) {
        let sonTpl = _options_.sonTpl || '';
        if(sonTpl) {
          sonTpl = _tplPath_+'/'+sonTpl.replace('.js','');
        }
        require([sonTpl],function(son) {          
          son = son || {};
          dump('loadSontpl over',son);
          //sontpl混入,增加callbacks属性
          opt.mixins.push(son,{
            data(){
              return {callbacks:son};
            },
          });
          return resolve(son);
        });
      });
      return promise;
    }   



    loadSontpl().then(function(sonTpl){
      // dump('sontpl over',sonTpl);
      new vue(opt);
    });
  })
});


